#ifndef YOOHOO_XDATA_XDATAFORMPARSERFACTORY_H
#define YOOHOO_XDATA_XDATAFORMPARSERFACTORY_H

#include "xdata/export.h"
#include "xmppcore/xmppparserfactory.h"
#include "xdata/xdataform.h"

namespace yoohoo_xdata {

using namespace yoohoo_xmppcore;

class XDataFormParser : public XmppParser {
public:
	XDataFormParser();
	~XDataFormParser();
	XmppObject* obj();
	bool processAttributes(QString path, QList<ParsingAttribute> attributes);
	bool processText(QString path, QString text);
	bool processEmbeddedObject(ProtocolKey protocolKey, XmppObject* object);

private:
	XDataForm* _dataForm;
	XDataField* _field;
	XDataItem* _item;
	XDataOption* _option;
	XDataReported* _reported;
};

class YOOHOO_XDATA_EXPORT XDataFormParserFactory : public XmppParserFactory {
public:
	static const ProtocolKey PROTOCOL_KEY;
	ProtocolKey protocolKey();
	XmppParser* createParser();
};

}

#endif
